package main

import "fmt"

type stringer interface {
	string()string
}

type tester interface {
	stringer
	test()string
}
type data struct {
	id int
	name string
}

func (d data)test() string {
	return d.name
}

func (d data) string() string {
	return d.name
}

// 定义空接口
type empty interface {}

func showmpType(q interface{}) {
	fmt.Printf("type:%T,value:%v\n", q, q)
}

// 接口类型可以进行嵌套
//定义总接口
type animal interface {
	peo
	dog
	cat
}
//定义包含的接口
type peo interface {
}
type dog interface {
}
type cat interface {
}
func main() {
	var d data
	d.name = "hello world"
	var t tester = &d
	fmt.Println(t.string())
	fmt.Println(t.test())
	showmpType("hello world")
}